package global

import (
	"go.uber.org/zap"
	"plg-log/config"
)

var (
	PLG_CONFIG *config.Config
	ZapLogger  *zap.Logger
	UserLogMap map[int64]*LogUser = make(map[int64]*LogUser)
	ActionsMap                    = map[int]string{
		1:  "user is login",
		2:  "user is logout",
		3:  "user is reset password",
		4:  "you have sent a message",
		5:  "current user is blocked",
		6:  "apply for new friend",
		7:  "accept friend request",
		8:  "decline friend request",
		9:  "send friend request",
		10: "friend request has been canceled",
		11: "you have received a friend request",
		12: "accept group request",
		13: "decline group request",
		14: "the owner has approved the request",
		15: "you have replied to the message",
		16: "the others have read the message",
		17: "your friend is writing a message",
		18: "please select a message before forwarding",
		19: "forwarding message to a friend",
		20: "sending a photo to a friend",
		21: "sending a file to a friend",
		22: "sending a voice message",
		23: "sending a video message",
		24: "creating a new group",
		25: "inviting someone to a group",
		26: "you have been invited to a group",
		27: "you have left the group",
		28: "group chat history has been cleared",
		29: "blocking a user",
		30: "unblocking a user",
	}
	ErrorMap = map[int]string{
		1:  "failed to login, incorrect username or password",
		2:  "failed to logout, session error",
		3:  "failed to reset password, invalid email or token",
		4:  "message sending failed, please try again later",
		5:  "you are blocked by the system, contact support",
		6:  "failed to apply for a new friend, unknown error",
		7:  "failed to accept friend request, request expired",
		8:  "failed to decline friend request, unknown error",
		9:  "failed to send friend request, user not found",
		10: "failed to cancel friend request, request not found",
		11: "failed to receive friend request, please try again",
		12: "failed to accept group request, you are not authorized",
		13: "failed to decline group request, request not found",
		14: "failed to approve the request, insufficient privileges",
		15: "failed to reply to message, message not found",
		16: "failed to mark message as read, try again later",
		17: "failed to see if your friend is writing, unknown error",
		18: "no message selected for forwarding",
		19: "message forwarding failed, target user not found",
		20: "failed to send photo, file too large",
		21: "failed to send file, unsupported file type",
		22: "failed to send voice message, network error",
		23: "failed to send video message, file size exceeds limit",
		24: "failed to create a new group, invalid group name",
		25: "failed to invite user to group, user not found",
		26: "failed to join the group, invitation expired",
		27: "failed to leave the group, unknown error",
		28: "failed to clear group chat history, insufficient permissions",
		29: "failed to block user, user does not exist",
		30: "failed to unblock user, you are not authorized",
	}
)

type LogUser struct {
	Id            int64  `json:"id" form:"id"`
	Name          string `json:"name" form:"name"`
	Age           int    `json:"age" form:"age"`
	Address       string `json:"address" form:"address"`
	Number        string `json:"number" form:"number"`
	Email         string `json:"email" form:"email"`
	DetailAddress string `json:"detail_address" form:"detail_address"`
	IsDelete      int    `json:"is_delete" form:"is_delete"`
	Gender        int    `json:"gender" form:"gender"`
	BirthDate     string `json:"birth_date" form:"birth_date"`
}
